﻿using System.Collections.Generic;

namespace Batman.Cms.Core.Models.Consul
{
    public class ConsulServiceModel
    {
        /// <summary>
        /// 服务Id
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 服务名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 服务标签
        /// </summary>
        public List<string> Tags { get; set; }

        /// <summary>
        /// 服务IP地址或者填localhost
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 服务部署的IP地址
        /// </summary>
        public int Port { get; set; }

        public bool EnableTagOverride { get; set; }

        /// <summary>
        /// 健康检查信息
        /// </summary>
        public ConsulHealthCheckInfo Check { get; set; }
    }

    /// <summary>
    /// 健康检查信息
    /// </summary>
    public class ConsulHealthCheckInfo
    {
        /// <summary>
        /// 例如 "90m"
        /// </summary>
        public string DeregisterCriticalServiceAfter { get; set; }

        /// <summary>
        /// 检查地址
        /// </summary>
        public string HTTP { get; set; }

        /// <summary>
        /// 健康检查间隔
        /// </summary>
        public string Interval { get; set; }
    }
}
